<template>
    <div>
        <h2 ref="title">哈哈哈哈哈</h2>
    </div>
</template>
<script>
import { ref, watchEffect } from 'vue';
export default {
    setup() {
        const title = ref(null);

        watchEffect(() => {
            console.log(title.value)  //第一次为null 
        }, {
         flush: "post"   //加上执行时机   
        })

        return {
            title
        }
    }
}
</script>
<style>
</style>
